<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>

<script type="text/javascript">
    var rowId = 0;
    $('fbox_logGrid .ui-reset , #refresh_logGrid').click(function(){
        $("#logGrid").jqGrid('setGridParam',{search:false});
        var postData = $("#logGrid").jqGrid('getGridParam','postData');
        $.extend(postData,{searchField:"",searchString:"",searchOper:""});
        $.extend(postData,{filters:""});
        $("#logGrid").trigger("reloadGrid");
    });

    $.subscribe('searchlogInfoGrid', function(event,data) {
        $("#logGrid").jqGrid('searchGrid', {closeAfterSearch:true,closeOnEscape:true,sopt:['eq'],caption:"Search log"} );
    });
    
    $.subscribe('logGridComplete',function(event,data){
        $( "#logGrid_search" ).button( "option", "disabled", false );
    });

</script>
<div class="gridOptsContainer">
    <sj:submit button="true" cssStyle="font-size:14px;" disabled="true" id="logGrid_search" onClickTopics="searchlogInfoGrid" value="Search log"/>
</div>
<s:url id="remoteurl" action="grid-log"/>

<sjg:grid
    id="logGrid"
    caption="Cashmate log"
    cellEdit="true"
    dataType="json"
    href="%{remoteurl}"
    gridModel="gridModel"
    pagerButtons="true"
    pagerInput="true"
    rowList="15,30,50"
    rowNum="15"
    loadingText="Requesting Data..."
    width="970"
    shrinkToFit="true"
    pager="true"
    hoverrows="true"
    rownumbers="true"
    autoencode="true"
    viewrecords="true"
    navigator="true"
    navigatorAdd="false"
    navigatorDelete="false"
    navigatorEdit="false"
    navigatorSearch="true"
    navigatorSearchOptions="{closeAfterSearch:true,closeOnEscape:true,sopt:['eq'],caption:'Search log'}"
    navigatorView="true"
    onGridCompleteTopics="logGridComplete"
    >

    <sjg:gridColumn name="logid"
                    index="logid"
                    title="Log ID"
                    sortable="false"
                    key="true"
                    hidden="true"
                    />

    <sjg:gridColumn name="description"
                    index="description"
                    title="Description"
                    sortable="true"
                    align="center"
                    />

  <sjg:gridColumn name="logdate"
                    index="logdate"
                    title="Log Date"
                    sortable="true"
                    align="center"
                    />
    <sjg:gridColumn name="employees.completename"
                    index="employees.completename"
                    title="Employee"
                    sortable="true"
                    align="center"
                    />



</sjg:grid>